import Http from "@/utils/http.js";
import {exp} from "three/tsl";

/**
 * 登录
 * @param username
 * @param password
 * @returns {Promise<axios.AxiosResponse<any>>}
 * @constructor
 */
export function RequestLogin(username,password){
    return Http.post('/api/login',{username:username,password:password});
}

/**
 *  注册
 * @param username
 * @param password
 * @returns {Promise<axios.AxiosResponse<any>>}
 * @constructor
 */
export function RequestRegister(username,password){
    return Http.post('/api/register',{username:username,password:password});
}

/**
 * 获取用户信息
 * @returns {Promise<axios.AxiosResponse<any>>}
 * @constructor
 */
export function RequestGetUserInfo(){
    return Http.get('/api/protected/user/getUserInfo');
}

/**
 * 修改用户信息
 * @param userInfo
 * @returns {Promise<axios.AxiosResponse<any>>}
 * @constructor
 */
export function RequestUpdateUserInfo(userInfo){
    return Http.post('/api/protected/user/updateUserInfo',userInfo);
}
